package com.dhzq.dataload.controller;

import com.dhzq.dataload.service.UserService;
import com.dhzq.dataload.vo.SecuMain;
import com.sun.istack.internal.NotNull;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author KevinYu
 * @version 1.0
 * @since 2021/9/23 15:36
 */
@RestController
@RequestMapping("user")
@Slf4j
@Api(tags = "用户管理")
public class UserController {
    @Autowired
    private UserService userService;

    @GetMapping("/findAll")
    @ApiOperation("查询所有系统用户")
    public List<?> getAllUser(){
        List userList= userService.getUsers();
        System.out.println("********************");
        log.info("用户列表："+userList);
        return userList;

    }

    @PutMapping("/{id}")
    @ApiOperation("根据id查询证券主表")
    public SecuMain findSecumainById(@ApiParam("证券ID") @NotNull @PathVariable long id){
        return userService.findSecumainById(id);


    }
}
